<strong><!DOCTYPE html>
<html >
	<head>
		<meta charset="utf-8">
		<title>事件绑定</title>
	</head>
	<body>
		<div id="app" v-cloak @click="">
			<span id="" v-for="aitem,index in item" >
				{{index}}:{{aitem}}
			</span>
			用户名：<input type="text" v-model="hello" />
			<button type="button" @click="push"> push</button>
			<button type="button" @click="pop">pop</button>
			<button type="button" @click="splice">splice</button>
			<button type="button" @click="sort">sort</button>
			<button type="button" @click="reverse">reverse</button>
		</div>
	</body>
</html>
<script src="../js/vue.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript"> 

	var v=new Vue({
		el:"#app",
		data:{
			hello:"",
			item:["qa","a","wo","lo"]
		},
		methods:{
			push(){
				this.item.push(this.hello)
			},
			pop(){
				this.item.pop()
			},
			splice(){
				this.item.splice(0,2,"nimade","zhenshige","choushabi","wocao")
			},
			sort(){
				this.item.sort()
			},
			reverse(){
				this.item.reverse()
			}
			
		},
		computed:{
			
		},
		watch:{
			
		}
	
	
	});
</script>
</strong>